home *** CD-ROM | disk | FTP | other *** search
- #include <stdlib.h>
- #include <stdio.h>
- #include <io.h>
- #include <fcntl.h>
- #include <stat.h>
- #include <conio.h>
- #include <dir.h>
- #include <dos.h>
- #include <time.h>
- #include <async.h>
- #include <process.h>
-
- #define HOST 1
- #define GUEST 0
- #define DATAFILE "CONFIGUR.DAT"
- #define OFFLINE (!(a_getmsr(P)&CRX) && !(bioskey(2)&64))
- #define TRY 3 /* number of attempts to resend garbled data block */
- #define CRX 128 /* carrier detect */
- #define OKTS 1 /* OK to send */
- #define SFR 2 /* send file request */
- #define IFR 3 /* initiate file receive */
- #define IFS 4 /* initiate file send */
- #define DF 5 /* delete file */
- #define RP 6 /* request password */
- #define SP 7 /* sending password */
- #define EM 8 /* error message */
- #define EOC 9 /* end of call */
- #define ACK 10 /* acknowledgement */
- #define NAK 11 /* not acknowledged */
- #define SDB 12 /* sending data block */
-
- void host_mode(void),beep(int,int),copyright(void),report(char *);
- void delete_files(char *,int),error_message(char *),end_of_call(void);
- void empty_box(int,int,int,int),tsr(unsigned int),b_sleep(int);
- void interrupt background_host_mode(void);
- void interrupt call(void);
- int initiate_file_send(char *,char *),send_file_request(unsigned char *,int);
- int init_modem(void),load_data(void),break_handler(void);
- int password_check(void),scb(int,int,unsigned char *),rcb(int,unsigned char *),agetc(void);
- int cmd_mode(int),seperate(char *,char *,char*,char);
- int create_local_file(char *),rdb(int,unsigned char *);
- char *eight_plus_three(char *,char);
-
- int WAITING,BAUD,COMM,RINGS,SCREENFLAG,LOGFILEFLAG,FLAGFILEFLAG;
- int I,C,TIMEOUT=180,IN_USE=0;
- long TIMER;
- char LOGFILE[61],FLAGFILE[61],PASSWORD[13];
- unsigned char TEMP[518],BUF[518],IOBUF[518];
- char SOURCE_PATHNAME[200],DEST_PATHNAME[200],FROM[200],TO[200];
- char PATH[100],PATHNAME[116];
- char SCREEN_BUFFER[644],RESTORE_BUFFER[644];
- struct ffblk F,F1;
-
- ASYNC *P=NULL;
-
- struct address{
- char far *p;};
-
- struct address far *int63=(struct address far *) 252;
- struct address far *int62=(struct address far *) 248;
- struct address far *int28h=(struct address far *) 160;
-
- struct tm *PTR;
- time_t LT;
-
- main(argc)
- int argc;
- {
- load_data();
-
- if(argc>1){
- cprintf("\n\rUsage: bhsend <no arguments> Run in background host mode\n\r");
- beep(3,400);
- exit(1);}
-
-
- if(int63->p!=int62->p){
- cprintf("\n\rBHSEND is already running.\n\r");
- exit(1);}
-
-
- TIMEOUT*=2; /* host waits longer */
- copyright();
-
- if(!init_modem()){
- gotoxy(1,21);
- textcolor(LIGHTGRAY);
- cprintf("\n\rCOMM device did not respond. Check settings with CONFIGUR.\n\r");
- beep(3,400);
- exit(1);}
-
-
- gotoxy(22,12);
- textcolor(LIGHTCYAN|BLINK);
- cprintf("Background program is running, please wait");
- gettext(20,8,65,14,SCREEN_BUFFER);
- gotoxy(22,12);
- cprintf(" ");
- gotoxy(1,24);
- textcolor(LIGHTGRAY);
- cprintf("HSEND background mode has been loaded into memory.");
- int62->p=int28h->p; /* move the old vector */
- int28h->p=(char far *)background_host_mode; /* put in the new vector */
- tsr(5473);
- }
-
-
- void interrupt background_host_mode(void) /* TSR enters here */
- {
- geninterrupt(62);
-
- if(!OFFLINE && !IN_USE){
- IN_USE++;
- gettext(20,8,65,14,RESTORE_BUFFER);
- puttext(20,8,65,14,SCREEN_BUFFER);
- LT=time(NULL);
- PTR=localtime(<);
- strcpy(TEMP,"On-line: ");
- strcat(TEMP,asctime(PTR));
- report(TEMP);
- if(password_check()) while(cmd_mode(1));
- LT=time(NULL);
- PTR=localtime(<);
- strcpy(TEMP,"Modem Reset: ");
- strcat(TEMP,asctime(PTR));
- report(TEMP);
- report("---------------------------------------------------------------------------\n\r");
- a_setmcr(P,0); /* hang up */ /* set DTR and RTS high */
- b_sleep(2);
- a_setmcr(P,MCR_DTR+MCR_RTS); /* set DTR and RTS high */
- b_sleep(1);
- a_puts("+++",P);
- b_sleep(2);
- a_puts("\n\rATZ\n\r",P);
- b_sleep(2);
- strcpy(TEMP,"AT S0=1 V0 &D3\n\r");
- TEMP[6]=RINGS+48; /* set correct value for S0 */
- a_puts(TEMP,P);
- C=a_icount(P);
- for(I=0;I<C;I++)
- a_getc(P);
- while(!OFFLINE); /* wait here */
- while(bioskey(1)) bioskey(0); /* empty keystroke buffer */
- puttext(20,8,65,14,RESTORE_BUFFER);
- IN_USE=0;
- }
-
-
- } /* TSR exits until next int28H call */
-
-
- int cmd_mode(host_flag) /* return 0 at end of sesssion */
- {
-
- for(;;){
- if(host_flag){
- if(!scb(OKTS,0,NULL)){ /* OK to send */
- report("ERROR- OKTS transmission not acknowledged");
- return 0;}}
-
-
- do{ /* receiving command */
- if(OFFLINE){
- report("DATA CONNECTION LOST");
- return 0;}
- C=rcb(0,BUF);
- }while(!C);
-
- switch(C){
-
- case OKTS: return -1;
-
- case SFR: send_file_request(BUF,0);
- break;
-
- case IFR: create_local_file(BUF);
- break;
-
- case DF: delete_files(BUF,HOST);
- break;
-
- case EM: error_message(BUF);
- break;
-
- case EOC: report("Transmission terminated normally");
- return 0;
-
- default: report("cmd_mode() default");
- if(!host_flag) return -1;} /* switch back to active mode */
-
-
- } /* endless loop */
- }
-
-
- void report(message)
- char *message;
- {
- int fp;
-
- if(!LOGFILEFLAG) return;
-
- if((fp=_open(LOGFILE,O_WRONLY|O_APPEND))==-1){
- if((fp=open(LOGFILE,O_CREAT,S_IWRITE))==-1){
- putch('!');
- return;}}
-
- if(write(fp,message,strlen(message))<0) beep(3,300);
- write(fp,"\n\r",2);
- close(fp);
- }
-
-
- int init_modem(void)
- {
- int x;
-
- if(P) a_close(P,0);
- P=a_open(COMM,BAUD,0,8,1,1040,1040); /* open at no parity,8 dbits, 1 sbit 1K input ,1k output buffer */
- a_setmcr(P,MCR_DTR+MCR_RTS); /* set DTR and RTS high */
- b_sleep(2);
- a_iflush(P); /* clear input buffer */
- b_sleep(1);
- a_puts("+++",P);
- b_sleep(2);
- a_puts("\n\rATZ\n\r",P);
- b_sleep(2);
- strcpy(TEMP,"AT s0=1 V0\n\r");
- TEMP[6]=RINGS+48; /* set correct value for S0 */
- a_puts(TEMP,P);
- a_waitquiet(P,18,72,1); /* wait for a reply */
- x=a_icount(P);
- while(a_icount(P)) a_getc(P); /* clear input buffer */
- return x; /* return # of characters in reply */
- } /* 0 return value denotes no modem present */
-
-
- int agetc(void) /* returns 0 if error occurs */
- {
-
- TIMER=biostime(0,0);
- do{
- if(OFFLINE) return -1; /* no carrier */
- if(a_icount(P)) return a_getc(P);
- }while(biostime(0,0)-TIMER<TIMEOUT);
-
- report("Timeout");
- return -2;
- }
-
-
- int password_check(void) /* return 1 if password is verified */
- {
- b_sleep(3);
- if(!scb(RP,0,NULL)){
- report("Caller could not verify Requesting Password transmission");
- return 0;}
- if(!rcb(SP,BUF)){
- report("Caller did not sent password");
- return 0;}
- if(!strcmp(BUF,PASSWORD)) return 1; /* correct password received */
- report("Incorrect password received.");
- return 0;
- }
-
-
- int scb(cmd,blklen,blk) /* send command block, returns 1 if acknowledged */
- int cmd; /* #defined command code */
- int blklen; /* number of data characters */
- unsigned char *blk; /* 0 to 512 data characters */
- { /* returns value of carrier detect */
- int i,try,reply;
- unsigned long cksum;
-
- while(a_icount(P)) a_getc(P); /* clear input buffer */
- IOBUF[3]=cmd; /* command code */
- IOBUF[4]=blklen/255; /* # of data chars hibyte */
- IOBUF[5]=blklen-(IOBUF[4]*255); /* # of data chars lobyte */
-
- if(blklen){ /* if there are data characters */
- for(i=0;i<blklen;i++) /* copy them into buf */
- IOBUF[i+6]=blk[i];}
-
- for(i=3,cksum=0;i<blklen+6;i++) /* add to create checksum */
- cksum+=IOBUF[i];
-
- IOBUF[0]=cksum/65025; /* checksum hibyte */
- cksum-=(long)IOBUF[0]*65025;
- IOBUF[1]=cksum/255; /* checksum midbyte */
- IOBUF[2]=cksum-(long)(IOBUF[1]*255); /* checksum lobyte */
-
- for(try=0;try<TRY;try++){
- for(i=0;i<blklen+6;i++)
- a_putc(IOBUF[i],P); /* send the block */
- reply=agetc();
- if(reply==ACK) return 1; /* OK */
- if(reply==-1) return 0; /* no carrier */
- if(reply!=NAK) while(a_icount(P)) a_getc(P);} /* remove the trash */
-
- return 0;
- }
-
-
- int rcb(cmd,blk) /* receive command block */
- int cmd; /* expected reply command */
- unsigned char *blk; /* fills blk with data chars received */
- { /* returns 0 if cannot verify block on TRY attempts */
- long cksum,tempsum;
- int i;
- int tmp,charcount;
-
- for(i=0;i<6;i++){ /* get first 6 characters */
- tmp=agetc();
- if(tmp<0) return 0;
- IOBUF[i]=tmp;}
-
- charcount=(IOBUF[4]*255)+IOBUF[5]; /* get remaining data characters */
- if(charcount){
- for(i=6;i<charcount+6;i++){
- tmp=agetc();
- if(tmp<0) return 0; /* no carrier or timeout */
- IOBUF[i]=tmp;
- blk[i-6]=tmp;}}
-
- for(tempsum=0,i=3;i<charcount+6;i++) /* create checksum of chars received */
- tempsum+=IOBUF[i];
-
- cksum=(long)IOBUF[0]*65025; /* create cheksum sent with data */
- cksum+=(long)IOBUF[1]*255;
- cksum+=IOBUF[2];
-
- if(cmd==0) cmd=IOBUF[3]; /* unknown command expected */
-
- if(cksum==tempsum && cmd!=IOBUF[3]) return 0;
-
- {if(cksum==tempsum && cmd==IOBUF[3]){
- a_putc(ACK,P);
- return IOBUF[3];} /* block OK returning cmd received */
- else{
- a_putc(NAK,P); /* block not OK */
- return 0;}}
- }
-
-
- int rdb(cmd,blk) /* receive data block */
- int cmd; /* expected reply command */
- unsigned char *blk; /* fills blk with data chars received */
- { /* returns 0 if cannot verify block on TRY attempts */
- long cksum,tempsum;
- int i;
- int tmp,charcount;
-
- for(i=0;i<6;i++){ /* get first 6 characters */
- tmp=agetc();
- if(tmp<0) return -1;
- IOBUF[i]=tmp;}
-
- charcount=(IOBUF[4]*255)+IOBUF[5]; /* get remaining data characters */
- if(charcount){
- for(i=6;i<charcount+6;i++){
- tmp=agetc();
- if(tmp<0) return -1; /* no carrier or timeout */
- IOBUF[i]=tmp;
- blk[i-6]=tmp;}}
-
- for(tempsum=0,i=3;i<charcount+6;i++) /* create checksum of chars received */
- tempsum+=IOBUF[i];
-
- cksum=(long)IOBUF[0]*65025; /* create cheksum sent with data */
- cksum+=(long)IOBUF[1]*255;
- cksum+=IOBUF[2];
-
- if(cmd==0) cmd=IOBUF[3]; /* unknown command expected */
-
- if(cksum==tempsum && cmd!=IOBUF[3]) return 0;
-
- {if(cksum==tempsum && cmd==IOBUF[3]){
- a_putc(ACK,P);
- return charcount;} /* block OK returning cmd received */
- else{
- a_putc(NAK,P); /* block not OK */
- return -1;}}
- }
-
-
- int create_local_file(filespec)
- char *filespec;
- {
- FILE *fp;
- int charcount,i,try;
- long size=0;
-
- strcpy(TEMP,"Creating local file: ");
- strcat(TEMP,filespec);
- report(TEMP);
-
-
- if((fp=fopen(filespec,"wb"))==NULL){ /* open the file */
- strcpy(TEMP,"ERROR- Unable to create file");
- report(TEMP);
- scb(EM,strlen(TEMP),TEMP);
- return 1;}
-
- if(!scb(IFS,0,NULL)){ /* start sending now */
- report("ERROR- Host unable to verify IFS transmission");
- fclose(fp);
- return 1;}
-
- try=1;
- do{
- charcount=rdb(SDB,BUF);
- if(OFFLINE){
- fclose(fp);
- report("ERROR- file transfer aborted (connection lost)");
- return 1;} /* no carrier */
- if(++try>TRY && charcount<0){
- fclose(fp);
- report("ERROR- file transfer aborted (receiving error)");
- return 1;}
- if(charcount){
- try=1;
- for(i=0;i<charcount;i++){
- if(ferror(fp)){
- fclose(fp);
- report("ERROR- File transfer aborted (I/O error)");
- return 1;}
- fputc(BUF[i],fp);}}
- size+=charcount;
- }while(charcount); /* stop when you rec. an empty block */
-
- i=ferror(fp);
- fclose(fp);
- return i; /* non zero equals error condition */
- }
-
-
- void error_message(msg)
- char *msg;
- {
- if(strlen(msg)>2) strcpy(TEMP,"Remote: ");
- else strcpy(TEMP," ");
- strcat(TEMP,msg);
- report(TEMP);
-
- }
-
-
- void delete_files(filespec,hostflag)
- char *filespec;
- int hostflag; /* set to 0 if deleting a file while in guest mode */
- {
- int i;
-
- strcpy(TEMP,"Deleting file(s): ");
- strcat(TEMP,filespec);
- report(TEMP);
-
- strcpy(PATH,filespec); /* create a PATH for remove command */
- for(i=strlen(PATH);i>0;i--){
- if(PATH[i]=='\\') break;
- PATH[i]=NULL;}
-
- if(findfirst(filespec,&F,0)){
- strcpy(TEMP,"No file(s) to delete");
- report(TEMP);
- if(hostflag) scb(EM,strlen(TEMP)+1,TEMP);
- return;}
-
- do{
- strcpy(TEMP,F.ff_name); /* temp used to report what files deleted */
- strcpy(PATHNAME,PATH); /* pathname is file to remove */
- strcat(PATHNAME,F.ff_name);
-
- {if(!remove(PATHNAME)){
- for(i=0;i<14-strlen(F.ff_name);i++)
- strcat(TEMP," ");
- strcat(TEMP,"deleted");
- report(TEMP);
- if(hostflag) scb(EM,strlen(TEMP)+1,TEMP);}
- else{
- for(i=0;i<14-strlen(F.ff_name);i++)
- strcat(TEMP," ");
- strcat(TEMP,"cannot be deleted");
- report(TEMP);
- if(hostflag) scb(EM,strlen(TEMP)+1,TEMP);}}
-
- }while(!findnext(&F));
- }
-
-
- int send_file_request(fromto,send_OKTS_flag) /* returns 1 if error, 0 on success */
- unsigned char *fromto; /* holds name of files to send */
- int send_OKTS_flag; /* set to 1 if sending from guest to host */
- {
- int i,c,errflag=0;
- char s[15],d[15];
-
- if(!seperate(fromto,FROM,TO,'|')){
- report("Source/destination seperation error");
- return 1;}
-
- if(findfirst(FROM,&F,0)){
- report("No files to send\n");
- return 0;}
-
- do{
- strcpy(SOURCE_PATHNAME,FROM); /* create a full source pathname */
-
- for(i=strlen(SOURCE_PATHNAME);i>0;i--){
- if(SOURCE_PATHNAME[i]=='\\') break;
- SOURCE_PATHNAME[i]=NULL;}
-
- strcat(SOURCE_PATHNAME,F.ff_name);
-
- strcpy(DEST_PATHNAME,TO); /* create a full dest. pathname */
- for(i=strlen(DEST_PATHNAME);i>0;i--){
- if(DEST_PATHNAME[i]=='\\') break;
- DEST_PATHNAME[i]=NULL;}
-
- strcpy(s,eight_plus_three(F.ff_name,'?')); /* store 8+3 filename in s */
-
- for(c=0,i=strlen(TO)-1;i>0;i--){ /* store 8+3 filename in d */
- if(TO[i]=='\\') break;
- TEMP[c++]=TO[i];}
- TEMP[c]=NULL;
- strrev(TEMP);
- strcpy(d,eight_plus_three(TEMP,'@'));
-
- for(i=0;i<8;i++){ /* convert the * char to ? */
- if(d[i]=='*'){
- for(;i<8;i++)
- d[i]='?';}}
- for(i=9;i<12;i++){
- if(d[i]=='*'){
- for(;i<12;i++)
- d[i]='?';}}
-
- for(i=0;i<12;i++) /* lay s on d */
- if(d[i]!='@') if(s[i]!='?' && d[i]=='?') d[i]=s[i];
-
- for(i=0;i<12;i++) /* remove trash */
- if(d[i]=='@' || d[i]=='?') d[i]=' ';
-
- for(i=0,c=0;i<12;i++) /* remove spaces */
- if(d[i]!=' ') TEMP[c++]=d[i];
- TEMP[c]=NULL;
-
- strcat(DEST_PATHNAME,TEMP); /* add to filename to path */
- strupr(DEST_PATHNAME);
-
- errflag=initiate_file_send(SOURCE_PATHNAME,DEST_PATHNAME); /* send the file */
- if(send_OKTS_flag) if(!rcb(OKTS,BUF)) rcb(OKTS,BUF);
-
- }while(!findnext(&F) && !errflag);
- return errflag;
- }
-
-
- int initiate_file_send(from,to) /* returns 1 on error, 0 if OK */
- char *from,*to;
- {
- long sent=0;
- int i;
- FILE *fp;
-
- if(findfirst(from,&F1,0)){
- report("Error reading filesize from directory");
- return 1;}
-
- strcpy(TEMP,"Dest: ");
- strcat(TEMP,to);
- report(TEMP);
-
- scb(IFR,strlen(to)+1,to); /* send null terminated pathname */
-
- if(!rcb(IFS,TEMP)){ /* OK to send file? */
- report("Error creating remote file");
- return 1;}
-
- if((fp=fopen(from,"rb"))==NULL){
- strcpy(TEMP,"Unable to read file: ");
- strcat(TEMP,from);
- report(TEMP);
- return 1;}
-
- do{
- for(i=0;i<512;i++){
- if(feof(fp) || ferror(fp)) break;
- sent++;
- BUF[i]=fgetc(fp);}
- if(feof(fp) || ferror(fp)){
- sent--;
- if(i) i--;} /* don't send an extra character */
- if(!scb(SDB,i,BUF)){
- strcpy(TEMP,"Unable to verify SDB transmission");
- scb(EM,strlen(TEMP)+1,TEMP);
- fclose(fp);
- report(TEMP);
- return 1;}
-
- }while(i);
-
- if(ferror(fp)){
- strcpy(TEMP,"ERROR- reading file");
- report(TEMP);
- scb(EM,strlen(TEMP)+1,TEMP);}
-
- fclose(fp);
- return 0;
- }
-
-
- int load_data(void)
- {
- FILE *fp;
- if((fp=fopen(DATAFILE,"r"))==NULL){
- cprintf("\n\rUnable to open configuration file %s\n\r",DATAFILE);
- perror("Reason");
- cprintf("\n\rRun CONFIGUR to create a new config file.\n\r");
- beep(3,400);
- exit(1);}
-
- else{
- fread(&BAUD,sizeof(BAUD),1,fp);
- fread(&COMM,sizeof(COMM),1,fp);
- fread(&RINGS,sizeof(RINGS),1,fp);
- fread(&SCREENFLAG,sizeof(SCREENFLAG),1,fp);
- fread(&LOGFILEFLAG,sizeof(LOGFILEFLAG),1,fp);
- fread(&LOGFILE,sizeof(LOGFILE),1,fp);
- fread(&FLAGFILEFLAG,sizeof(FLAGFILEFLAG),1,fp);
- fread(&FLAGFILE,sizeof(FLAGFILE),1,fp);
- fread(&PASSWORD,sizeof(PASSWORD),1,fp);
- fread(&WAITING,sizeof(WAITING),1,fp);
- fclose(fp);}
-
- return 1;
- }
-
-
- void copyright(void)
- {
- system("cls");
- textbackground(BLACK);
- textcolor(LIGHTCYAN);
- empty_box(20,8,65,14);
- gotoxy(29,10);
- cprintf("H-SEND File Transfer System");
- gotoxy(22,12);
- cprintf("(C) John Hutchey 1991 All Rights Reserved");
- }
-
-
- void beep(loop,freq)
- int loop,freq;
- {
- int i;
- unsigned char p;
- long timer;
-
- union{
- long divisor;
- unsigned char c[2];
- }count;
-
- for(i=0;i<loop;i++){
- count.divisor=1193280/freq;
- outportb(67,182);
- outportb(66,count.c[0]);
- outportb(66,count.c[1]);
- p=inportb(97);
- outportb(97,p|3);
-
- timer=biostime(0,0);
- while(biostime(0,0)-timer<3);
-
- outportb(97,p);
-
- timer=biostime(0,0);
- while(biostime(0,0)-timer<1);}
- }
-
-
- int seperate(combined,first,second,seperator)
- char *combined,*first,*second,seperator;
- {
- int i,c;
-
- for(i=0;i<strlen(combined);i++)
- if(combined[i]==seperator) break;
- if(i==strlen(combined)) return 0; /* no seperator present in string */
-
- for(i=0;i<strlen(combined);i++){
- if(combined[i]==seperator) break;
- first[i]=combined[i];}
- first[i]=NULL; /* first half of *combined copied to *first */
-
- for(i++,c=0;i<=strlen(combined);i++)
- second[c++]=combined[i]; /* second half of *combined copied to *second */
-
- return 1; /* OK */
- }
-
-
- char *eight_plus_three(source,fill)
- char *source;
- char fill;
- {
- static char a[15];
- char b[5];
- char filler[2];
-
- filler[0]=fill;
- filler[1]=NULL;
-
- if(!seperate(source,a,b,'.')){
- strcpy(a,source);
- b[0]=NULL;}
-
- while(strlen(a)<8) strcat(a,filler); /* pad to 8 chars */
- strcat(a,"."); /* add a period */
- strcat(a,b); /* add extension */
- while(strlen(a)<12) strcat(a,filler); /* pad to 12 chars */
- return a; /* return pointer to converted string */
- }
-
-
- void tsr(size) /* terminate and stay resident enable */
- unsigned int size;
- {
- union REGS r;
-
- r.h.ah=49;
- r.h.al=0;
- r.x.dx=size;
- int86(0x21,&r,&r);
- }
-
-
- void empty_box(start_x,start_y,end_x,end_y)
- int start_x,start_y,end_x,end_y;
- {
- int x,y;
-
- /* set up corners */
- gotoxy(start_x,start_y);
- cprintf("%c",201);
- gotoxy(end_x,start_y);
- cprintf("%c",187);
- gotoxy(start_x,end_y);
- cprintf("%c",200);
- gotoxy(end_x,end_y);
- cprintf("%c",188);
-
- /* top & bottom line */
- for(x=start_x+1;x<end_x;x++){
- gotoxy(x,start_y);
- cprintf("%c",205);
- gotoxy(x,end_y);
- cprintf("%c",205);}
-
- /* side lines */
- for(y=start_y+1;y<end_y;y++){
- gotoxy(start_x,y);
- cprintf("%c",186);
- gotoxy(end_x,y);
- cprintf("%c",186);}
-
- }
-
-
- void b_sleep(seconds) /* replaces standard sleep function */
- {
- long timer;
-
- timer=biostime(0,0);
- while(biostime(0,0)-timer<seconds*18);
- }